package com.neusoft.ai.function.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

/**
 * @author zzc
 * @since 2025/6/13 下午2:56
 */
@Configuration
public class CalculatorService {
    public record AddOperation(int a, int b) {

    }

    public record MulOperation(int m, int n) {

    }

    @Bean
    @Description("加法计算服务")
    public Function<AddOperation, Integer> addOperation() {
        return request -> request.a + request.b;
    }

    @Bean
    @Description("乘法计算服务")
    public Function<MulOperation, Integer> mulOperation() {
        return request -> request.m * request.n;
    }
}
